import service from "./index"

export function addType(data) {
    return service({
        url: "/folderType/add",
        method: 'post',
        params: data
    })
}

// 获取类型列表
export function getTypeList() {
    return service({
        url: "/folderType/list",
        method: 'post',
        data: {}
    })
}
// 删除类型
export function deleteType(id) {
    return service({
        url: "/folderType/delete",
        method: 'post',
        params: {
            id: id
        }
    })
}

//更新类型
export function updateType(data) {
    return service({
        url: "/folderType/update",
        method: 'post',
        params: data
    })
}

// 获取切片size
export function getSliceSize() {
    return service({
        url: "/file/up/chunkSizeByte",
        method: 'post',
        data: {}
    })
}

// 文件是否存在 秒传
export function checkFileExist(data) {
    return service({
        url: "/file/up/checkFile",
        method: 'post',
        params: data
    })
}

//上传文件不分片
export function uploadFile(data) {
    return service({
        url: "/file/up/upload",
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

//上传文件分片
export function uploadFileSlice(data) {
    return service({
        url: "/file/up/chunk",
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

//合并文件分片
export function mergeFileSlice(data) {
    return service({
        url: "/file/up/merge",
        method: 'post',
        params: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

// 创建文件夹
export function createFolder(data) {
    return service({
        url: "/webDisk/file/makeFile",
        method: 'post',
        data
    })
}

// 创建文件夹
export function getFileList(data) {
    return service({
        url: "/webDisk/file/list",
        method: 'post',
    })
}

// 文件和路径结合
// export function mergeFilePath(data) {
//     return service({
//         url: "/webDisk/file/detail",
//         method: 'post',
//         params: data
//     })
// }

// 秒传根据hash获取文件信息
export function getFileByHash(data) {
    return service({
        url: "/file/up/getNewFileByMd5",
        method: 'post',
        params: data
    })
}














































































































